﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using PSI.Models;
using PSI.Services;

namespace PSI.Controllers {
    public class BaseCodeAdminMetadataColumnController : PSI.Helper.PSIController {
        //
        // GET: /BaseCodeAdminMetadataColumn/

        public ActionResult Index() {
            return View();
        }


        [HttpPost]
        public ActionResult GetItem(string clid) {

            var item = new BaseCodeMetadataColumnService().GetMetadataColumnItem(clid);

            return Json(new { Data = item });

        }

        [HttpPost]
        public ActionResult GetSing(string id) {

            var item = new BaseCodeMetadataColumnService().GetSing(id);

            return Json(new { Data = item });

        }

        [HttpPost]
        public ActionResult AddColumn(BaseCodeColumnMatedata model) {

            var result = new BaseCodeMetadataColumnService().AddMetadataColumn(model);

            return Json(result);

        }

    }
}
